-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Registered all namespaces in ModuleTemplateLoader class #9173
Registered all namespaces in ModuleTemplateLoader class #9173
Conversation
*/ | ||
public function setRegisteredPaths($registeredPaths) | ||
{ | ||
dump($registeredPaths); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:'(
$templatePaths[] = $dir; | ||
} | ||
} | ||
$this->setPaths($templatePaths, $namespace); | ||
} | ||
} | ||
|
||
/** | ||
* @return array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why add this two functions? Where are they used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some tests, removed 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments
<tr><td colspan="11"> | ||
{% endblock %} | ||
{% else %} | ||
<tr><td colspan="11"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird indent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was here previously, improving it now may make the contribution unreadable
"icon": "remove_red_eye", | ||
"label": "Preview"|trans({}, 'Admin.Actions') | ||
} | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
{% if activate_drag_and_drop and has_category_filter %}class="sortable"{% endif %} | ||
last_sql="{{ last_sql_query|escape('html_attr') }}" | ||
{% if activate_drag_and_drop and has_category_filter %}class="sortable"{% endif %} | ||
last_sql="{{ last_sql_query|escape('html_attr') }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe should be a data-
attribute?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope! we dont change anything here: not the scope of this contribution.
HALTE AU GRABUGE !
'Product': '/Admin/Product' | ||
'Twig': '/Admin/TwigTemplateForm' | ||
'AdvancedParameters': '/Admin/Configure/AdvancedParameters' | ||
'ShopParameters': '/Admin/Configure/ShopParameters' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not store this list elsewhere, like in a config or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used just once, not sure it's necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because this won't be re-used.
At start, I wanted to re-use the paths used in framework configuration, but thinking about it it's not a good idea. The 'array' look like the same but they have really different purposes.
If we have another place/service when we want to re-use it, of course I'm also in favor of extracting it into a parameter.
Note you can access to all registered Twig paths and namespaces using php bin/console debug:twig
but not us, cause of weird call of Legacy Context in a Twig extension. This is a really minor issue we should try to fix asap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we'll need to add new namespaces as we migrate new sections, won't we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, so we will append new namespaces here.
But before I need to document which namespaces should be added as there is no real consistency actually: some templates use them, others don't, some namespace refers to a page, others to sections or even categories...
Once we will have consistency, I'm pretty sure we won't even need to configure an Array, but maybe loop into actual folders and declare namespaces dynamically ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as it isn't done in runtime...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes everything setting in yml files are automatically converted in string / array in the cache file =)
@PierreRambaud LGTM? ;) |
Thanks @mickaelandrieu |
PrestaShop
was registered.products_table.html.twig
inmodules/your-module/views/PrestaShop/Admin/Product/CatalogPage/Lists/products_table.html.twig
with empty content. You should see no products anymore in your products catalog pageImportant guidelines
This change is